<?php 

class Logincon extends CI_Controller {
    
        public function __construct() {
        parent::__construct();
        $this->load->library('form_validation');
        
        }
	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{            
           $data = array (
               'nomb' => $this->input->post("nombre"),
               'pass' => $this->input->post("password"),               
           );
          
                
            $this->form_validation->set_error_delimiters('<span class="mensaje-error">','</span>');
            if ($this->form_validation->run('Login') === FALSE)
		{                    
                    $this->load->view('frontend/Login');                    
		}
		else
		{                    
                    if ( $data['nomb'] == "Admin" && $data['pass'] == "1234")
                    $this->load->view('Menu/mMenu');
                    else {
                        if ( $data['nomb'] == "Usuario" && $data['pass'] == "1234")
                        $this->load->view('frontend/Consulta');
                        else
                           echo '<img src="http://localhost/trunk/Pr-bd1-ce/assets/img/acd.png" border=0>';             
                    }
                       
		}    
	}
              
        
        
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
